package converter

import pb "grpc_demo/proto_gen"

type LoginReq struct {
	StuId    string
	Password string
}

type LoginResp struct {
	Code    int32
	Message string
}

func Login2LoginReq(in *pb.LoginRequest) LoginReq {
	return LoginReq{
		StuId:    in.GetStuId(),
		Password: in.GetPassword(),
	}
}

func Login2LoginResp(resp LoginResp) *pb.LoginResponse {
	return &pb.LoginResponse{
		Code:    resp.Code,
		Message: resp.Message,
	}
}
